#pragma once
#include <vector>
#include <iostream>
class Char_queue {
public:
    Char_queue() {};
    ~Char_queue() {};
    bool empty() const { return v.empty() == 1; };
    bool full() const { return false; }
    char dequeue();                 //出队 
    void enqueue(char);             //入队 
    void print();             
private:
    std::vector<char> v;
};

inline void Char_queue::enqueue(char ch){
    v.push_back(ch);
}

inline char Char_queue::dequeue() {
    if (v.empty())throw("The queue is EMPTY");
    char reChar = v.at(0);
    v.erase(v.begin());
    std::cout << "出队：";
    return reChar;
}

inline void Char_queue::print(){
    if (v.empty()){
        std::cout << "队列为空" << std::endl;
        return;
    }
    
    for (std::vector<char>::iterator iter = v.begin(); iter != v.end(); iter++) {
        std::cout << *iter << "!";
    }
    std::cout << std::endl;
}
